const Component = ({ is, list, ...props }) => {
  //通过is来判断list里对应的组件的name,找到以后返回组件
  if (typeof is === "string") {
    return Array.isArray(list) && list.find(item => item.name === is)(props);
  } else if (typeof is === "function") {
    return is(props);
  } else if (typeof is === "object") {
    // const Name = new is(props) 
    console.log(is)
    return <is></is>;
  } else {
    console.error("缺少is属性或类型不对");
    return "";
  }
};
export default Component;
